Micron Document
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| SparkN0de-git | SparkN0de |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Commit 1f7302903ab2fc1840c13ac360eb71ec9a86cd29


Parents : 5736012
Author : Mark Qvist <mark@unsigned.io>
Date : 2024-01-08T00:10:55+01:00

Fixed missing timestamp update on page/file periodic scan

Changes

3 files changed, 25 insertions(+), 3 deletions(-)


Diff

diff --git a/nomadnet/Node.py b/nomadnet/Node.py
index 836833b..70b455c 100644
--- a/nomadnet/Node.py
+++ b/nomadnet/Node.py
@@ -50,6 +50,8 @@ class Node:
def register_pages(self):
+ # TODO: Deregister previously registered pages
+ # that no longer exist.
self.servedpages = []
self.scan_pages(self.app.pagespath)
@@ -69,6 +71,8 @@ class Node:
)
def register_files(self):
+ # TODO: Deregister previously registered files
+ # that no longer exist.
self.servedfiles = []
self.scan_files(self.app.filespath)
@@ -230,10 +234,12 @@ class Node:
if self.page_refresh_interval > 0:
if now > self.last_page_refresh + self.page_refresh_interval*60:
self.register_pages()
-
+ self.last_page_refresh = time.time()
+
if self.file_refresh_interval > 0:
if now > self.last_file_refresh + self.file_refresh_interval*60:
self.register_files()
+ self.last_file_refresh = time.time()
time.sleep(self.job_interval)

diff --git a/nomadnet/NomadNetworkApp.py b/nomadnet/NomadNetworkApp.py
index 5777bbf..bfe71f1 100644
--- a/nomadnet/NomadNetworkApp.py
+++ b/nomadnet/NomadNetworkApp.py
@@ -1077,6 +1077,22 @@ announce_at_start = Yes
# and generally you do not need to use it.
# prioritise_destinations = 41d20c727598a3fbbdf9106133a3a0ed, d924b81822ca24e68e2effea99bcb8cf
+# Automatic rescan interval of the pages directory in minutes.
+# Default: int = 0 (no rescan)
+page_refresh_interval = 0
+
+# You can specify the interval in minutes for
+# rescanning the hosted pages path. By default,
+# this option is disabled, and the pages path
+# will only be scanned on startup.
+# page_refresh_interval = 0
+
+# You can specify the interval in minutes for
+# rescanning the hosted files path. By default,
+# this option is disabled, and the files path
+# will only be scanned on startup.
+# file_refresh_interval = 0
+
[printing]
# You can configure Nomad Network to print

diff --git a/nomadnet/ui/textui/Guide.py b/nomadnet/ui/textui/Guide.py
index e9d9d27..e0935c7 100644
--- a/nomadnet/ui/textui/Guide.py
+++ b/nomadnet/ui/textui/Guide.py
@@ -624,7 +624,7 @@ Determines where the node server will look for hosted pages. Must be a readable
>>>
`!page_refresh_interval = 0`!
>>>>
-Determines the interval in seconds for rescanning the hosted pages path. By default, this option is disabled, and the pages path will only be scanned on startup.
+Determines the interval in minutes for rescanning the hosted pages path. By default, this option is disabled, and the pages path will only be scanned on startup.
<
>>>
@@ -636,7 +636,7 @@ Determines where the node server will look for downloadable files. Must be a rea
>>>
`!file_refresh_interval = 0`!
>>>>
-Determines the interval in seconds for rescanning the hosted files path. By default, this option is disabled, and the files path will only be scanned on startup.
+Determines the interval in minutes for rescanning the hosted files path. By default, this option is disabled, and the files path will only be scanned on startup.
<
>>>


──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────